
window.onload=function (ev) {
    var script = document.createElement("script");
    script.setAttribute("type","text/javascript");
    script.setAttribute("src","static/js/simpleAjax.js");
    document.getElementsByTagName('head')[0].appendChild(script);
}

function regist(){
    var username = document.getElementById("username").value;
    var password = document.getElementById("password").value;

    ajaxRequest("regist.php","get",{username:username,password:password},function () {
        alert(this.responseText);
        window.location="login_page.php";
    },function () {
        alert("error");
        window.location="regist_page.php";
    })

}